package com.sky.service.impl;

import com.sky.entity.TWalletRecord;
import com.sky.dao.TWalletRecordDao;
import com.sky.service.TWalletRecordService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

import javax.annotation.Resource;
import java.util.List;

/**
 * (TWalletRecord)表服务实现类
 * @author sky
 * @since 2022-11-15 11:56:23
 */
@Service
@Transactional
public class TWalletRecordServiceImpl implements TWalletRecordService {

    @Resource
    private TWalletRecordDao tWalletRecordDao;

    /**
     * 通过ID查询单条数据
     * @param walletRecordId 主键
     * @return 实例对象
     */
	@Override
    public TWalletRecord queryById(Long walletRecordId) {
        return tWalletRecordDao.queryById(walletRecordId);
    }

    /**
     * 分页查询
     *
     * @param tWalletRecord 筛选条件
     * @return 查询结果
     */
	@Override
    public PageInfo<TWalletRecord> queryByPage(TWalletRecord tWalletRecord) {
        PageHelper.startPage(tWalletRecord.getPageNum(), tWalletRecord.getPageSize());
        List<TWalletRecord> list = tWalletRecordDao.queryByPage(tWalletRecord);
        return new PageInfo<>(list);
    }

    /**
     * 新增数据
     * @param tWalletRecord 实例对象
     * @return 实例对象
     */
	@Override
    public void insert(TWalletRecord tWalletRecord) {
        tWalletRecordDao.insert(tWalletRecord);
    }

}
